all:
	ninja -C build

install:
	ninja -C build install

clean:
	ninja -C build clean

run: all
	SPA_PLUGIN_DIR=build/spa/plugins \
	PIPEWIRE_MODULE_DIR=build \
	PIPEWIRE_CONFIG_FILE=build/src/daemon/pipewire.conf \
	build/src/daemon/pipewire

monitor: all
	SPA_PLUGIN_DIR=build/spa/plugins \
	PIPEWIRE_MODULE_DIR=build/src/modules/ \
	build/src/tools/pipewire-monitor

cli: all
	SPA_PLUGIN_DIR=build/spa/plugins \
	PIPEWIRE_MODULE_DIR=build/src/modules/ \
	build/src/tools/pipewire-cli

dist: all
	git archive --prefix=pipewire-@VERSION@/ -o pipewire-@VERSION@.tar.gz @TAG@

rpm: dist
	rpmbuild -ta pipewire-@VERSION@.tar.gz

publish: all
	git branch -D gh-pages 2>/dev/null || true && \
	git branch -D draft 2>/dev/null || true && \
	git checkout -b draft && \
	git add -f build/doc/html && \
	git commit -anm "Deploy on gh-pages" && \
	git subtree split --prefix build/doc/html -b gh-pages && \
	git push --force origin gh-pages:gh-pages && \
	git checkout master 2>/dev/null
